package com.pikaqiu.warehouse.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.pikaqiu.warehouse.domain.entity.MaterialProduct;
import com.pikaqiu.warehouse.mapper.MaterialProductMapper;
import com.pikaqiu.warehouse.service.MaterialProductService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author Administrator
* @description 针对表【material_product】的数据库操作Service实现
* @createDate 2024-08-14 14:08:23
*/
@Service
public class MaterialProductServiceImpl extends ServiceImpl<MaterialProductMapper, MaterialProduct>
    implements MaterialProductService {

    @Override
    public List<MaterialProduct> listProductMaterialsByProduct(Integer productId) {
        return list(new QueryWrapper<MaterialProduct>().eq("product_id", productId));
    }

    @Override
    public List<MaterialProduct> listProductMaterialsByMaterial(Integer materialId) {
        return list(new QueryWrapper<MaterialProduct>().eq("material_id", materialId));
    }
}




